﻿@page "/"
@using BlazorShared.Models
@attribute [TabItemOption(Text = "首页", Icon = "fa fa-fa")]

<h1>Blazor Demo</h1>
<Title>BlazorMaui</Title>
<TimerAme />

<Tab>
    <TabItem Text="环境">
        <br />
        <b>
            版本:
        </b>
        <br />
        @version
        <br /><br />
        <b>
            FriendlyName:
        </b>
        <br />
        @AppDomain.CurrentDomain.FriendlyName
        <br /><br />
        <b>
            TargetFrameworkName:
        </b>
        <br />
        @AppDomain.CurrentDomain.SetupInformation.TargetFrameworkName
        <br /><br />
    </TabItem>
    <TabItem Text="本机IP">
        <br />
        <b>
            机器码 ID:
        </b>
        <br />
        @IPAddressManager.GetIdentifier();
        <br /><br />
        IPAddressManager<br />
        <b>
            IP:
        </b><br />
        @IPAddressManager.GetIPAddress();
        <br /><br />
        <b>
            IPs:
        </b><br />
        @if (IPAddressManager != null && IPAddressManager?.GetIPAddresList() != null)
        {
            foreach (var item in IPAddressManager.GetIPAddresList())
            {
                @item;
                <br />

            }
        }
        <br /><br />
        WebClientInfo<br />
        <b>
            IP:
        </b><br />
        @WebClientInfo.ClientIpAddress;
        <br /><br />
        <Button Text="粘贴" OnClick="粘贴" />
        <span>@文字</span>
    </TabItem>
</Tab>


@inject AppState AppState


<p>The current count is <strong>@AppState.Counter</strong></p>

<button class="btn btn-primary" @onclick="IncrementCount">Increment</button>

<p>This is a shared component</p>

@code {
    public int Counter { get; set; } = 1;


    void IncrementCount()
    {
        AppState.Counter++;
    }

    [JSInvokable]
    public static Task<int[]> ReturnArrayAsync()
    {
        return Task.FromResult(new int[] { 1, 2, 3 });
    }
}